.problem-management {
  background: linear-gradient(135deg, #e8f4fd 0%, #d6ebf7 100%);
  min-height: 100vh;
  padding: 20px;

  &-container {
    display: flex;
    min-height: calc(100vh - 40px);
    gap: 20px;
  }

  /* 左侧侧边栏样式 - 改为卡片形式 */
  .problem-sidebar {
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    .sidebar-header {
      padding: 24px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      border-bottom: none;
    }

    .sidebar-menu {
      padding: 20px 0;

      .menu-item {
        margin: 0 16px 8px 16px;
        padding: 12px 16px;
        cursor: pointer;
        transition: all 0.3s;
        border-radius: 8px;
        border-left: none;

        &:hover {
          background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
          transform: translateX(4px);
        }

        &.active {
          background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
          color: white;
          font-weight: 500;
          box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }
      }
    }

    .sidebar-stats {
      padding: 20px 24px;
      border-top: 1px solid #f0f0f0;
      background: linear-gradient(135deg, #f8f9ff 0%, #f5f7ff 100%);

      .stat-item {
        margin-bottom: 16px;

        .stat-bar {
          height: 8px;
          background-color: #f0f0f0;
          border-radius: 4px;
          margin-bottom: 8px;
          overflow: hidden;

          .stat-progress {
            height: 100%;
            border-radius: 4px;
            transition: width 0.3s;
          }
        }

        .stat-info {
          display: flex;
          justify-content: space-between;
          font-size: 12px;
          color: #666;
        }
      }
    }
  }

  .ant-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    font-weight: 600;

    &:hover {
      background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
  }

}

/* 右侧内容区域样式 */
.problem-content {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;

  &-inner {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
  }
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  h2 {
    margin: 0;
    color: #2c3e50;
  }
}

.problem-form {
  max-width: 1200px;
  margin: 0 auto;
}

.form-section {
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  .ant-card-head {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 8px 8px 0 0;

    &-title {
      color: white;
      font-weight: 600;
      font-size: 16px;
    }
  }

  .ant-card-extra {
    color: white;

    .ant-btn {
      color: white;
      border-color: white;

      &:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: white;
        color: white;
      }
    }
  }
}

.markdown-editor-container {
  margin-bottom: 16px;
}

.editor-help {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.example-section {
  margin-bottom: 16px;

  .ant-typography {
    margin-bottom: 8px;
    display: block;
  }
}

.test-case-item {
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  margin-bottom: 16px;
  background-color: #fafafa;

  &:last-child {
    margin-bottom: 0;
  }
}

.test-case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;

  .ant-typography {
    margin: 0;
    color: #2c3e50;
  }
}

.form-actions {
  text-align: center;
  padding: 32px 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-top: 24px;
}

/* Markdown编辑器样式优化 */
.w-md-editor {
  background-color: white;

  &-text-textarea,
  &-text {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  &-text-textarea {
    padding: 12px !important;
  }

  &-preview {
    padding: 12px !important;

    strong {
      color: #45beff !important;
    }

    pre {
      background-color: #f6f8fa !important;
      border: 1px solid #e1e4e8 !important;
      border-radius: 6px !important;
      padding: 16px !important;
      overflow-x: auto !important;

      code {
        background-color: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
        font-size: 14px !important;
      }
    }

    code {
      background-color: #f6f8fa !important;
      padding: 2px 4px !important;
      border-radius: 3px !important;
      font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
      font-size: 85% !important;
    }
  }
}

/* 页面标题区域样式 */
.page-header-section {
  margin-bottom: 24px;
  padding: 0;
  border: none;
  background: transparent;
}

.page-title-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 0;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;

  .ant-btn {
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 400;
  }
}

/* 表单项样式优化 */
.ant-form-item-label {
  >label {
    font-weight: 600;
    color: #2c3e50;
  }
}

.ant-input,
.ant-select-selector,
.ant-input-number {
  border-radius: 6px;
  border-color: #e2e8f0;

  &:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
  }
}

.ant-select-focused .ant-select-selector {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}


.ant-tag {
  border-radius: 4px;
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .problem-management {
    padding: 16px;

    &-header {
      flex-direction: column;
      gap: 16px;
      align-items: stretch;
    }

    .form-actions {
      padding: 24px 16px;
    }

    .test-case-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }
  }
}

/* 加载状态样式 */
.ant-spin-container {
  min-height: 200px;
}

/* 测试用例按钮样式优化 */
.ant-card-extra {
  .ant-btn-primary.ant-btn-background-ghost {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;

    &:hover {
      background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
      transform: translateY(-2px);
      box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
      color: white;
    }

    &:active {
      transform: translateY(0);
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
  }
}

/* 测试用例卡片样式 */
.test-case-item {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #e8f4fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff 0%, #f0f9ff 100%);
  transition: all 0.3s ease;

  &:hover {
    border-color: #91caff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
  }
}

/* 自定义滚动条 */
.w-md-editor-text-textarea,
.ant-input {
  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;

    &:hover {
      background: #a8a8a8;
    }
  }
}